<li class="message">
  <div class="profile-image">
  <%if !(message.other_person(current_person).nil?)%>
    <%= image_link message.other_person(current_person),
                   :image => :thumbnail,
                   :image_options => { :class => "photo" } %>
    <%end%>

    <%- if not message.read? and not current_person?(message.sender) -%>
      <%= image_tag("icons/email.gif", :class => "icon") %>
    <%- elsif message.replied_to? -%>
      <%= image_tag("icons/reply.gif", :class => "icon" )  %>
    <%- end -%>    
  </div>
  <p>
    <%- if current_person?(message.sender) -%>
      <span class="label">To:</span>
      <%= person_link message.recipient, :class => "url fn" %>
    <%- else -%>
      <span class="label">From:</span>
        <%if !(message.sender.nil?)%>
      <%= person_link message.sender, :class => "url fn" %>
      <%end%>
    <%- end -%>
    <span class="meta"><%= time_ago_in_words message.created_at %> ago</span>
  </p>
  <p>
    <span class="label">Subject:</span>
    <%= link_to sanitize(message.subject),
                message_path(message, :anchor => message_anchor(message)) %>
  </p>
  <p class="tools meta">
    <%= link_to "Read", message %> |
    <%= link_to "Reply", reply_message_path(message) %> |
    <% unless message.trashed?(current_person) -%>
      <%= link_to("Trash", message, :method => :delete) %>
    <% else -%>
      <%= link_to "Untrash", undestroy_message_path(message),
                             :method => :put %>
    <% end -%>    
  </p>
</li>